import { queryChange } from '@/api/accountApply'

export default {
  namespaced: true,
  state: {
    // 声明数据
    changes: []
  },
  mutations: {
    // 声明申请突变
    SET_CHANGE(state, payload) {
      state.changes = payload
    }
  },
  actions: {
    // 查询所有申请
    async queryChanges({ commit }, params) {
      const res = await queryChange(params)
      // console.log(res); // res.data.list[]是我们需要的数组
      commit('SET_CHANGE', res.data.list)
    }
  }
}
